package com.lottery.dao.qiuqiu.lobbyDao;

import com.lottery.entity.Lottery;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface LotteryDao {

	/**
	 * 分页查询彩票开奖表
	 * 
	 *            分页类
	 */
	List<Lottery> selectLotteryList(@Param(value = "startPage") int startPage, @Param(value = "pageSize") int pageSize,
                                    @Param(value = "expect") String expect, @Param("lotteyType") int lotteyType);

	/**
	 * 根据期号查询开奖时间
	 *
	 * @param expect
	 *            期号
	 */
	Lottery selectLotteryByExpect(String expect);

	/**
	 * 插入数据
	 *
	 * @param lottery
	 *            彩票开奖记录
	 */
	long insertLottery(Lottery lottery);

	/**
	 * 根据时间查询期号
	 *
	 */
	List<String> selectExpectByExpect(String except);
	/**
	 * 根据时间查询期号
	 */
	List<String> selectExpectByExpectNew(Map<String, Object> map);

    Lottery selectLotteryDetail(@Param(value = "expect") String expect, @Param(value = "lotteyType") int lotteyType);

    List<Lottery> searchBetZoushi(Map<String,Object> params);

    @Select("SELECT * from lottery where DATE_FORMAT(opentime,'%Y%m%d') !=  DATE_FORMAT(NOW(),'%Y%m%d') and lottey_type = 3 ORDER BY opentime desc limit 0,1")
    Lottery selectExpectYesterday();
}
